#pragma once

#include <iostream>
#include <utility>
#include <vector>
#include <unordered_map>

struct User
{
    User()
    {}
    User(const std::string &ip,const uint16_t port)
    :_ip(ip),_port(port)
    {

    }
    ~User()
    {

    }
    std::string _ip;
    uint16_t _port;
};

class UserManage
{
public:
    UserManage()
    {

    }
    void Insert(std::string &ip,uint16_t port)
    {
        _user_table.push_back(User(ip,port));

        for(auto& v : _user_table)
        {
            std::cout << v._ip << ":  " << v._port << std::endl;
         }
    }
    std::string Ip(int n)
    {
        return _user_table[n]._ip;
    }
    uint16_t Port(int n)
    {
        return _user_table[n]._port;
    }
    int Size()
    {
        return _user_table.size();
    }
    ~UserManage()
    {

    }
private:
    std::vector<User> _user_table;
};
